using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using T2.WebSecurity.Business;
using T2.WebSecurity.Business.Entities.Interfaces;
using T2.WebSecurity.Business.Entities;
using T2.WebSecurity.Business.Entities.Search.Interfaces;
using T2.WebSecurity.Business.Entities.Search;
namespace T2.WebSecurity.Business.Workflow.Activites
{
	public sealed class Db_T2_WebSecurity_UsersInRoles_Search : CodeActivity
	{
		private IBusinessService bs = null;
		public OutArgument<IUsersInRoles_biz[]> RetVal { get; set; }
		public InArgument<IBusinessService> BS {get;set;}
		public InArgument<IUsersInRolesSearch_biz> SearchParam { get; set; }
		private IUsersInRolesSearch_biz searchParam ;
		protected override void Execute(CodeActivityContext context)
		{
			bs = context.GetValue(BS);
			searchParam = context.GetValue(SearchParam);
			IUsersInRoles_biz[] tempReturn = UsersInRoles_Search(searchParam);
			context.SetValue(RetVal, tempReturn);
		}
		public IUsersInRoles_biz[] UsersInRoles_Search(IUsersInRolesSearch_biz param)
		{
			try
			{
				List<IUsersInRoles_biz> retVal = bs.UsersInRolesController_Search(param, true, true);
				return retVal.ToArray();
			}
			catch (Exception ex)
			{
				throw new ApplicationException(ex.Message);
			}
		}
	}
}
